package com.buaa.aiguangxi.utils;

import com.alibaba.fastjson.JSONObject;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class JsonUtil {
	public static Object load(String dir, String path) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(dir + "/" + path)));

		String text = "";
		String line = "";

		while ((line = in.readLine()) != null) {
			text += line;
		}
		Object object = JSONObject.parse(text);
		in.close();

		return object;
	}
}
